

#import "UTSOcTools.h"
#import <objc/runtime.h>

@implementation UTSOcTools
+ (void)baidunaviDisableJump{
    Class BNaviService =  NSClassFromString(@"BNaviService");
    Method getInstance = class_getClassMethod(BNaviService, NSSelectorFromString(@"getInstance"));
    const char *typeEncoding = method_getTypeEncoding(getInstance);
    NSMethodSignature *signature = [NSMethodSignature signatureWithObjCTypes:typeEncoding];
    NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
    invocation.target = BNaviService;
    invocation.selector = NSSelectorFromString(@"getInstance");
    [invocation invoke];
    // 如果 getInstance 方法有返回值，并且你需要获取它，可以使用以下代码：
    id BNaviServiceInstance; // 假设返回值是 id 类型，根据实际情况调整类型。
    [invocation getReturnValue:&BNaviServiceInstance];
    NSLog(@"BNaviServiceInstance: %@", BNaviServiceInstance); // 处理或打印返回值。
    
    Method routePlanManager = class_getInstanceMethod(BNaviService, NSSelectorFromString(@"routePlanManager"));
    typeEncoding = method_getTypeEncoding(routePlanManager);
    signature = [NSMethodSignature signatureWithObjCTypes:typeEncoding];
    NSInvocation *invocationRoutePlanManager = [NSInvocation invocationWithMethodSignature:signature];
    invocationRoutePlanManager.target = BNaviServiceInstance;
    invocationRoutePlanManager.selector = NSSelectorFromString(@"routePlanManager");
    [invocationRoutePlanManager invoke];
    id routePlanManagerInstance;
    [invocationRoutePlanManager getReturnValue:&routePlanManagerInstance];
    NSLog(@"routePlanManagerInstance: %@", routePlanManagerInstance);
    
    [routePlanManagerInstance setValue:@YES forKey:@"disableOpenUrl"];
    
}

@end



